package com.tre.jdevtemplateboot.common.dto;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * @author JDev
 */
@Component
@ConfigurationProperties(prefix = "com.tre.jdev")
public class PropertiesConfig implements Serializable {

    private static final long serialVersionUID = 1L;

    @Value("token-category")
    private String tokenCategory;

    @Value("refresh-token")
    private String refreshToken;

    @Value("add-path-patterns")
    private String addPathPatterns;

    @Value("exclude-path-patterns")
    private String excludePathPatterns;

    @Value("${pre-user-issuer:jdev}")
    private String preUserIssuer;

    @Value("${pre-user-subject:web}")
    private String preUserSubject;

    @Value("${token-expire:7200000}")
    private String tokenExpire;

    @Value("${refresh-token-expire:86400000}")
    private String refreshTokenExpire;

    @Value("${token-security-key:46cc793c53dc451b8a4fe2cd0bb008471}")
    private String tokenSecurityKey;

    @Value("${auth_header_key:Authorization}")
    private String authHeaderKey;

    @Value("${auth_type_prefix:Bearer }")
    private String authTypePrefix;

    @Value("${header-device-key:deviceId}")
    private String headerDeviceKey;

    public String getAuthHeaderKey() {
        return authHeaderKey;
    }

    public void setAuthHeaderKey(String authHeaderKey) {
        this.authHeaderKey = authHeaderKey;
    }

    public String getAuthTypePrefix() {
        return authTypePrefix;
    }

    public void setAuthTypePrefix(String authTypePrefix) {
        this.authTypePrefix = authTypePrefix;
    }

    public String getTokenCategory() {
        return tokenCategory;
    }

    public String getRefreshToken() {
        return refreshToken;
    }

    public String getAddPathPatterns() {
        return addPathPatterns;
    }

    public String getExcludePathPatterns() {
        return excludePathPatterns;
    }

    public String getPreUserIssuer() {
        return preUserIssuer;
    }

    public String getPreUserSubject() {
        return preUserSubject;
    }

    public String getTokenExpire() {
        return tokenExpire;
    }

    public String getTokenSecurityKey() {
        return tokenSecurityKey;
    }

    public void setTokenCategory(String tokenCategory) {
        this.tokenCategory = tokenCategory;
    }

    public void setRefreshToken(String refreshToken) {
        this.refreshToken = refreshToken;
    }

    public void setAddPathPatterns(String addPathPatterns) {
        this.addPathPatterns = addPathPatterns;
    }

    public void setExcludePathPatterns(String excludePathPatterns) {
        this.excludePathPatterns = excludePathPatterns;
    }

    public void setPreUserIssuer(String preUserIssuer) {
        this.preUserIssuer = preUserIssuer;
    }

    public void setPreUserSubject(String preUserSubject) {
        this.preUserSubject = preUserSubject;
    }

    public void setTokenExpire(String tokenExpire) {
        this.tokenExpire = tokenExpire;
    }

    public void setTokenSecurityKey(String tokenSecurityKey) {
        this.tokenSecurityKey = tokenSecurityKey;
    }

    public String getHeaderDeviceKey() {
        return headerDeviceKey;
    }

    public void setHeaderDeviceKey(String headerDeviceKey) {
        this.headerDeviceKey = headerDeviceKey;
    }

    public String getRefreshTokenExpire() {
        return refreshTokenExpire;
    }

    public void setRefreshTokenExpire(String refreshTokenExpire) {
        this.refreshTokenExpire = refreshTokenExpire;
    }

}
